package com.witmore.ftp.db.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * FTP连接记录实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ftp_connections")
public class FtpConnectionDO {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 会话ID
     */
    @TableField("session_id")
    private String sessionId;

    /**
     * 用户名
     */
    @TableField("username")
    private String username;

    /**
     * 客户端IP
     */
    @TableField("client_ip")
    private String clientIp;

    /**
     * 客户端端口
     */
    @TableField("client_port")
    private Integer clientPort;

    /**
     * 连接时间
     */
    @TableField("connect_time")
    private LocalDateTime connectTime;

    /**
     * 断开时间
     */
    @TableField("disconnect_time")
    private LocalDateTime disconnectTime;

    /**
     * 连接状态（CONNECTED, DISCONNECTED）
     */
    @TableField("status")
    private String status;

    /**
     * 连接持续时间（秒）
     */
    @TableField("duration")
    private Long duration;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 创建者ID
     */
    @TableField("creator")
    private Integer creator;

    /**
     * 更新者ID
     */
    @TableField("updator")
    private Integer updator;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Integer isDeleted;
}
